package com.knight.study.patterns.tujie.chain;

/**
 * @Author knight
 * @Date 2024/9/11 17:14
 */

public class ChainMain {
    public static void main(String[] args) {
        Support alice = new NoSupport("Alice");
        final LimitSupport bob = new LimitSupport("Bob", 100);
        final SpecialSupport charlie = new SpecialSupport("Charlie", 429);
        final LimitSupport diana = new LimitSupport("Diana", 200);
        final OddSupport elmo = new OddSupport("Elmo");
        final LimitSupport fred = new LimitSupport("Fred", 300);
        alice.setNext(bob).setNext(charlie).setNext(diana).setNext(elmo).setNext(fred);
        for (int i = 0; i < 500; i += 33) {
            alice.support(new Trouble(i));
        }
    }
}
